package com.itany.corejava.day13;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestFileIOStream {

    public static void main(String[] args) {

        FileInputStream fis=null;
        FileOutputStream fos=null;


        try {
            fis=new FileInputStream("d:/a.txt");
            fos=new FileOutputStream("d:/b.txt");

            int b;

            while((b=fis.read())!=-1){
                fos.write(b);
            }

        } catch (Exception e){
            e.printStackTrace();
        } finally {
            if(fis!=null){
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if(fos!=null){
                try {
                    fos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }


    }
}
